<template>
  <div>
    <div v-for="item in imgArr" :key="index" class="card">
      <image lazy-load class="width100" :src="item" mode="widthFix"  />
    </div>
    <div class="btn-full-box">
      <button class="btn-full" @tap="hardMake">{{btnText}}</button>
    </div>
  </div>
</template>

<script>
import getPuerperaBookingImg from '@/interface/picture/getPuerperaBookingImg'

export default {
  components: { },
  data () {
    return {
      img: '',
      btnText: '',
      imgObj: {
        kr: {
          bizType: 'breas_opening_image',
          id: '1108667300351991808'
        },
        cr: {
          bizType: 'lactation_image',
          id: '1108667300351991808'
        },
        myh: {
          bizType: 'full_moon_sweat_image',
          id: '1108667300351991808'
        },
        chxf: {
          bizType: 'postpartum_repair_image',
          id: '1108667300351991808'
        },
        yezs: {
          bizType: 'parenting_knowledge_image',
          id: '1108667300351991808'
        },
        myz: {
          bizType: 'full_moon_illumination_image',
          id: '1108667300351991808'
        }
      },
      imgArr: []
    }
  },
  methods: {
    hardMake () {
      const query = this.$root.$mp.query
      wx.navigateTo({
        url: `/pages/puerperaBooking/${query.type}/main`
      })
    }
  },

  mounted () {
    const type = this.$root.$mp.query.type
    if (type === 'yezs') {
      this.btnText = '立即报名'
    } else {
      this.btnText = '立即预约'
    }
    getPuerperaBookingImg(this.imgObj[type]).then(list => {
      this.imgArr = list
    })
  }
}
</script>
<style lang="less">
  .card{
    margin-bottom: 15px;
    .width100 {
      height: auto;
    }
  }
</style>